package documentation.workbench

import groovy.transform.CompileStatic
import javafx.event.Event
import javafx.scene.Node
import javafx.stage.Stage
import javafx.stage.StageStyle
import org.jacpfx.api.annotations.workbench.Workbench
import org.jacpfx.api.componentLayout.WorkbenchLayout
import org.jacpfx.api.message.Message
import org.jacpfx.api.util.ToolbarPosition
import org.jacpfx.rcp.componentLayout.FXComponentLayout
import org.jacpfx.rcp.workbench.FXWorkbench

import static documentation.config.IDs.*

/**
 * @author Misty
 */
@CompileStatic
@Workbench(id = WORKBENCH_ONE,
        name = "workbench",
        perspectives = [PERSPECTIVE_TWO, PERSPECTIVE_ONE])
class JacpFXWorkbench implements FXWorkbench {
    @Override
    void postHandle(FXComponentLayout layout) {

    }

    @Override
    void handleInitialLayout(final Message<Event, Object> action,
                             final WorkbenchLayout<Node> layout,
                             final Stage stage) {
        layout.setWorkbenchXYSize(1024, 600)
        layout.registerToolBar(ToolbarPosition.NORTH)
        layout.style = StageStyle.DECORATED
        layout.menuEnabled = false
    }
}
